//
//  ViewController.m
//  按钮控制划线
//
//  Created by mac on 15-11-6.
//  Copyright (c) 2015年 ztt. All rights reserved.
//

#import "ViewController.h"
#import "QuartzCore/QuartzCore.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
/*    UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, 200, 0, 3)];
    line.backgroundColor = [UIColor blackColor];
    [self.view addSubview:line];
    
    UIView * line2 = [[UIView alloc] initWithFrame:CGRectMake(self.view.frame.size.width/2.0, 0, 6, 0)];
    line2.backgroundColor = [UIColor blackColor];
    [self.view addSubview:line2];
    
    [UIView animateWithDuration:0.6 animations:^{//匿名函数
        line.frame = CGRectMake(0, 200, self.view.frame.size.width, 3);
    } completion:^(BOOL finish){//回调函数
        [UIView animateWithDuration:0.6 animations:^{
            line2.frame = CGRectMake(self.view.frame.size.width/2.0, 0, 3, self.view.frame.size.height);
            [UIView animateWithDuration:0.6 animations:^{
                line.frame = CGRectMake(self.view.frame.size.width,200,0,6);
                line2.frame = CGRectMake(self.view.frame.size.width/2.0, 0, 6, self.view.frame.size.height);
            } completion:^(BOOL finish){
                [UIView animateWithDuration:0.6 animations:^{
                    line2.frame = CGRectMake(self.view.frame.size.width/2.0, self.view.frame.size.height, 6, 0);
                }];
            }];
        }];
    }];
    */
    for (int i = 0; i<3; i++) {
        UIView * l = [[UIView alloc] initWithFrame:CGRectMake(0 , 200, 0, 3)];
        l.backgroundColor = [UIColor blackColor];
        [self. view addSubview:l];
        
    }
    
    for (int i = 0; i<5; i++) {
        UIView *v = [[UIView alloc] initWithFrame:CGRectMake(i*20+i*50, 100 , 3, 50)];
        v.backgroundColor = [UIColor yellowColor];
        
        v.layer.cornerRadius = 50/2.0;
        v.clipsToBounds = YES;
        
        [self.view addSubview:v];
    }
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
